import com.alibaba.druid.pool.DruidDataSource;
import com.itheima.config.SpringConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author 刘全
 * @date 2021/9/12
 */
public class test {
    public static void main(String[] args) {
//        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
//        DataSource dataSource = ac.getBean("dataSource", DataSource.class);
//        System.out.println(dataSource);

        ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfig.class);
        DruidDataSource dataSource = ac.getBean("dataSource", DruidDataSource.class);

        System.out.println(dataSource);
    }
}
